﻿namespace SafetyRecordData.Data.DAL
{
    using System;
    using System.Data;
    using Ths.Components.Common;

    [Serializable]
    public class DADepartMent : DBBase
    {
        public DADepartMent()
        {
            base.TableName = "SafePunish";
            base.PKField = "AppID";
        }

        public DADepartMent(string connectionStringName) : base(connectionStringName)
        {
            base.TableName = "SafePunish";
            base.PKField = "AppID";
        }

        public string ReturnJgName(string departID)
        {
            string SQL_GetList = "select a.JgName as jgname from qp_hr_jigou a,qp_hr_JiGou b where a.id=b.ParentNodesID and b.id='" + departID + "'";
            DataTable dt = base.DBFactory.GetDataTable(SQL_GetList);
            if (dt.Rows.Count > 0)
            {
                return dt.Rows[0]["jgname"].ToString();
            }
            return "";
        }
    }
}

